package com.ruoyi.znjc.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.znjc.mapper.ZnjcRulesMapper;
import com.ruoyi.znjc.domain.ZnjcRules;
import com.ruoyi.znjc.service.IZnjcRulesService;

/**
 * 农业规则Service业务层处理
 * 
 * @author ZNJC
 * @date 2025-07-23
 */
@Service
public class ZnjcRulesServiceImpl implements IZnjcRulesService 
{
    @Autowired
    private ZnjcRulesMapper znjcRulesMapper;

    /**
     * 查询农业规则
     * 
     * @param ruleId 农业规则主键
     * @return 农业规则
     */
    @Override
    public ZnjcRules selectZnjcRulesByRuleId(Long ruleId)
    {
        return znjcRulesMapper.selectZnjcRulesByRuleId(ruleId);
    }

    /**
     * 查询农业规则列表
     * 
     * @param znjcRules 农业规则
     * @return 农业规则
     */
    @Override
    public List<ZnjcRules> selectZnjcRulesList(ZnjcRules znjcRules)
    {
        return znjcRulesMapper.selectZnjcRulesList(znjcRules);
    }

    /**
     * 新增农业规则
     * 
     * @param znjcRules 农业规则
     * @return 结果
     */
    @Override
    public int insertZnjcRules(ZnjcRules znjcRules)
    {
        znjcRules.setCreateTime(DateUtils.getNowDate());
        return znjcRulesMapper.insertZnjcRules(znjcRules);
    }

    /**
     * 修改农业规则
     * 
     * @param znjcRules 农业规则
     * @return 结果
     */
    @Override
    public int updateZnjcRules(ZnjcRules znjcRules)
    {
        znjcRules.setUpdateTime(DateUtils.getNowDate());
        return znjcRulesMapper.updateZnjcRules(znjcRules);
    }

    /**
     * 批量删除农业规则
     * 
     * @param ruleIds 需要删除的农业规则主键
     * @return 结果
     */
    @Override
    public int deleteZnjcRulesByRuleIds(Long[] ruleIds)
    {
        return znjcRulesMapper.deleteZnjcRulesByRuleIds(ruleIds);
    }

    /**
     * 删除农业规则信息
     * 
     * @param ruleId 农业规则主键
     * @return 结果
     */
    @Override
    public int deleteZnjcRulesByRuleId(Long ruleId)
    {
        return znjcRulesMapper.deleteZnjcRulesByRuleId(ruleId);
    }
}
